package com.example.swd1.gudong.main.user.systemoption;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.preference.PreferenceCategory;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.swd1.gudong.R;

/**
 * Created by user on 9/8/16.
 */
public class OptionPreferenceCategory extends PreferenceCategory {
    private String title;
    private TextView tv_option_category_title;

    public OptionPreferenceCategory(Context context, AttributeSet attrs) {
        super(context, attrs);
        TypedArray a = context.obtainStyledAttributes(attrs,R.styleable.CategoryPreference);
        title = a.getString(R.styleable.CategoryPreference_title);
        a.recycle();
    }

    @Override
    protected void onBindView(View view) {
        super.onBindView(view);
        tv_option_category_title = (TextView) view.findViewById(R.id.tv_option_category_title);
        tv_option_category_title.setText(title);
    }

    @SuppressLint("MissingSuperCall")
    @Override
    protected View onCreateView(ViewGroup parent) {
        return LayoutInflater.from(getContext()).inflate(R.layout.preference_category_option, parent, false);
    }
}
